package com.shexianyu.simple;

/**
 * @author shexianyu
 * @desc 344. 反转字符串
 * @date 2021/12/3
 */
public class ReverseString {
    // h e l l o
    public void reverseString(char[] s) {
        int n = s.length;
        for (int i = 0; i < n / 2; i++) {
            char temp = s[n - i - 1];
            s[n - i - 1] = s[i];
            s[i] = temp;
        }
    }
}
